package basicSort.mergeSort;

import java.util.Arrays;

import static basicSort.mergeSort.MergeSort.merge;

public class Main {
    public static void main(String[] args) {
        int count = 50000;

        int[] arr = new int[count];

        //为数组随机赋值
        for ( int i = 0 ; i < count ; i++){
            arr[i] =(int) (Math.random() * count);
        }

        long start = System.currentTimeMillis();
        merge(arr);
        long end = System.currentTimeMillis();
        System.out.println(end - start);


        start = System.currentTimeMillis();
        Arrays.sort(arr);
        end = System.currentTimeMillis();
        System.out.println(end - start);
        /*for ( int i = 0 ; i < count ; i++){
            System.out.print(arr[i]+" ");
        }*/

    }
}
